#{extends 'main.html' /}
#{set title:'Search Results' /}
<div id=main>

<div id="search-results">
<h1>Search Results</h1>
#{if relationList}

Found ${relationList.size()} item${relationList.pluralize()} matching
'${source}-${relationName}-${destination}'

<ul>
#{list items:relationList, as:'Relation'}

#{if Relation.type == "entity"}
<li><a href="@{AdvancedSearch.showSourceEntity(Relation.id)}">${Relation.source} </a></li>
#{/if}

#{elseif Relation.type == "topic"}
<li><a href="@{AdvancedSearch.showSourceTopic(Relation.id)}">${Relation.source} </a></li>
#{/elseif} 

#{elseif Relation.type == "tag"}
<li><a href="@{AdvancedSearch.showSourceTag(Relation.id)}">${Relation.source} </a></li>
#{/elseif} 

<li><a href="@{AdvancedSearch.showSearchRelation(Relation.id)}">${Relation.relationName}- ${Relation.postedAt} </a></li>



#{if Relation.type == "entity"}
<li><a href="@{AdvancedSearch.showDestinationEntity(Relation.id)}">${Relation.destination} </a></li>
#{/if}
#{elseif Relation.type == "topic"}
<li><a href="@{AdvancedSearch.showDestinationTopic(Relation.id)}">${Relation.destination} </a></li>
#{/elseif} 

#{elseif Relation.type == "tag"}
<li><a href="@{AdvancedSearch.showDestinationTag(Relation.id)}">${Relation.destination} </a></li>
#{/elseif}

</br>
#{/list}
</ul>
#{/if}
#{else}
Sorry! We did not find any results matching '${source}-${relationName}-${destination}'
#{/else}
</div>
</div>